package zlx.service.Impl;

import org.springframework.stereotype.Service;
import zlx.mapper.BookMapper;
import zlx.pojo.Book;
import zlx.pojo.Page;
import zlx.service.IndexService;

import javax.annotation.Resource;
import java.util.List;

@Service(value = "indexService")
public class IndexServiceImpl implements IndexService {
        @Resource
        private BookMapper bookMapper;


        //查询所有图书信息
        @Override
        public Page<Book> selectAllBook(Integer pageNo) {
            Integer totalCount = bookMapper.countAllBook();
            Page page=new Page(totalCount,null,null,pageNo);
            List<Book> books = bookMapper.selectAllBook(page.getStart(),page.getPageSize());
            page.setItems(books);
            return page;
        }

}
